package in.andante.android.Hello_World;   
   
import android.app.Activity;   
import android.os.Bundle;   
import android.view.View;   
import android.view.View.OnClickListener;   
import android.widget.Button;   
import android.widget.TextView;
   
public class ButtonClick extends Activity implements OnClickListener {   
    /** Called when the activity is first created. */   
    private Button btn;   
	int count=0;
	
    @Override   
    public void onCreate(Bundle savedInstanceState) {   
        super.onCreate(savedInstanceState);   
        setContentView(R.layout.main);   
        btn = (Button)findViewById(R.id.button1);   
        btn.setText("please,click");   
        btn.setOnClickListener(this);   
    }   
   

    @Override   
    public void onClick(View v){   
        TextView _helloWorldWord = new TextView(this);
       if(v == btn){
    	   if(0 == count ) {
    		   _helloWorldWord.setText("Hello World !");
    		   count = 1;
    	   }
    	   else {
    		   _helloWorldWord.setText("");
    		   count = 0;
    	   }
		   setContentView(_helloWorldWord);  	   
        }   
    }   
   
}  